using I2.Loc;
using UnityEngine;

public class MarketMiniInfoPanel : MonoBehaviour
{
	public UILabel title;

	public UILabel description;

	[HideInInspector]
	public Product currentProduct;

	public UISprite RareTypeSprite;

	public UILabel RareTypeLabel;

	public virtual void SetTitleLocalization()
	{
		if ((bool)title)
		{
			string text = ScriptLocalization.Get("Market/" + currentProduct.id + "_title");
			title.text = ((!string.IsNullOrEmpty(text)) ? text : "Нет локализации!");
		}
	}

	public virtual void SetDescriptionLocalization()
	{
		if ((bool)description)
		{
			string text = ScriptLocalization.Get("Market/" + currentProduct.id + "_info");
			description.text = ((!string.IsNullOrEmpty(text)) ? text : "Нет локализации!");
		}
	}

	public virtual void SetAdditionalDescriptionLocalization(UILabel label)
	{
		string text = ScriptLocalization.Get("Market/" + currentProduct.id + "_additional_info");
		label.text = ((!string.IsNullOrEmpty(text)) ? text : "Нет локализации!");
	}

	public virtual void SetRareType()
	{
		if ((bool)RareTypeSprite)
		{
			RareTypeSprite.spriteName = "RareType_" + currentProduct.rare;
			RareTypeLabel.text = ScriptLocalization.Get("Market/RareType_" + currentProduct.rare);
			RareTypeSprite.gameObject.SetActive(true);
		}
	}
}
